package com.woniu.smart.service.impl;

import com.woniu.smart.entity.Buildfloor;
import com.woniu.smart.mapper.BuildfloorMapper;
import com.woniu.smart.service.BuildfloorService;
import com.woniu.smart.vo.BuildfloorVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 楼层的服务层接口实现类
 *
 * @author 晨星
 * @date 2022/10/21/15:34
 */
@Service
public class BuildfloorServiceImpl implements BuildfloorService {

    @Autowired
    private BuildfloorMapper buildfloorMapper;

    /**
     * 查询所有楼层信息
     *
     * @author 晨星
     * @param id 楼宇id
     * @date 2022/10/21 15:17
     * @return java.util.List<com.woniu.smart.entity.Buildfloor>
     **/
    @Override
    public List<BuildfloorVo> selectAllBuildfloor(Long id) {
        return buildfloorMapper.selectAllBuildfloor(id);
    }

    /**
     * 根据id删除楼层
     *
     * @author 晨星
     * @date 2022/10/21 15:29
     * @param id 主键id
     * @return int
     **/
    @Override
    public int deleteByPrimaryKey(Long id) {
        return buildfloorMapper.deleteByPrimaryKey(id);
    }

    /**
     * 新增楼层信息
     *
     * @author 晨星
     * @date 2022/10/21 15:30
     * @param record 楼层的实体类
     * @return int
     **/
    @Override
    public int insertSelective(Buildfloor record) {
        return buildfloorMapper.insertSelective(record);
    }

    /**
     * 根据id查询楼层
     *
     * @author 晨星
     * @date 2022/10/21 15:32
     * @param id 主键id
     * @return com.woniu.smart.entity.Buildfloor
     **/
    @Override
    public Buildfloor selectByPrimaryKey(Long id) {
        return buildfloorMapper.selectByPrimaryKey(id);
    }

    /**
     * 修改楼层信息
     *
     * @author 晨星
     * @date 2022/10/21 15:33
     * @param record 楼层的实体类
     * @return int
     **/
    @Override
    public int updateByPrimaryKeySelective(Buildfloor record) {
        return buildfloorMapper.updateByPrimaryKeySelective(record);
    }
}
